import { PAYMASTER_API } from './api';
import * as Errors from './api';

// NOTE: generated with scripts/generateRpcErrorMap.js
export type RPC_ERROR_SET = {
  FAILED_TO_RECEIVE_TXN: Errors.FAILED_TO_RECEIVE_TXN;
  NO_TRACE_AVAILABLE: Errors.NO_TRACE_AVAILABLE;
  CONTRACT_NOT_FOUND: Errors.CONTRACT_NOT_FOUND;
  ENTRYPOINT_NOT_FOUND: Errors.ENTRYPOINT_NOT_FOUND;
  BLOCK_NOT_FOUND: Errors.BLOCK_NOT_FOUND;
  INVALID_TXN_INDEX: Errors.INVALID_TXN_INDEX;
  CLASS_HASH_NOT_FOUND: Errors.CLASS_HASH_NOT_FOUND;
  TXN_HASH_NOT_FOUND: Errors.TXN_HASH_NOT_FOUND;
  PAGE_SIZE_TOO_BIG: Errors.PAGE_SIZE_TOO_BIG;
  NO_BLOCKS: Errors.NO_BLOCKS;
  INVALID_CONTINUATION_TOKEN: Errors.INVALID_CONTINUATION_TOKEN;
  TOO_MANY_KEYS_IN_FILTER: Errors.TOO_MANY_KEYS_IN_FILTER;
  CONTRACT_ERROR: Errors.CONTRACT_ERROR;
  TRANSACTION_EXECUTION_ERROR: Errors.TRANSACTION_EXECUTION_ERROR;
  STORAGE_PROOF_NOT_SUPPORTED: Errors.STORAGE_PROOF_NOT_SUPPORTED;
  CLASS_ALREADY_DECLARED: Errors.CLASS_ALREADY_DECLARED;
  INVALID_TRANSACTION_NONCE: Errors.INVALID_TRANSACTION_NONCE;
  INSUFFICIENT_RESOURCES_FOR_VALIDATE: Errors.INSUFFICIENT_RESOURCES_FOR_VALIDATE;
  INSUFFICIENT_ACCOUNT_BALANCE: Errors.INSUFFICIENT_ACCOUNT_BALANCE;
  VALIDATION_FAILURE: Errors.VALIDATION_FAILURE;
  COMPILATION_FAILED: Errors.COMPILATION_FAILED;
  CONTRACT_CLASS_SIZE_IS_TOO_LARGE: Errors.CONTRACT_CLASS_SIZE_IS_TOO_LARGE;
  NON_ACCOUNT: Errors.NON_ACCOUNT;
  DUPLICATE_TX: Errors.DUPLICATE_TX;
  COMPILED_CLASS_HASH_MISMATCH: Errors.COMPILED_CLASS_HASH_MISMATCH;
  UNSUPPORTED_TX_VERSION: Errors.UNSUPPORTED_TX_VERSION;
  UNSUPPORTED_CONTRACT_CLASS_VERSION: Errors.UNSUPPORTED_CONTRACT_CLASS_VERSION;
  UNEXPECTED_ERROR: Errors.UNEXPECTED_ERROR;
  REPLACEMENT_TRANSACTION_UNDERPRICED: Errors.REPLACEMENT_TRANSACTION_UNDERPRICED;
  FEE_BELOW_MINIMUM: Errors.FEE_BELOW_MINIMUM;
  INVALID_SUBSCRIPTION_ID: Errors.INVALID_SUBSCRIPTION_ID;
  TOO_MANY_ADDRESSES_IN_FILTER: Errors.TOO_MANY_ADDRESSES_IN_FILTER;
  TOO_MANY_BLOCKS_BACK: Errors.TOO_MANY_BLOCKS_BACK;
  COMPILATION_ERROR: Errors.COMPILATION_ERROR;
  //
  INVALID_ADDRESS: PAYMASTER_API.INVALID_ADDRESS;
  TOKEN_NOT_SUPPORTED: PAYMASTER_API.TOKEN_NOT_SUPPORTED;
  INVALID_SIGNATURE: PAYMASTER_API.INVALID_SIGNATURE;
  MAX_AMOUNT_TOO_LOW: PAYMASTER_API.MAX_AMOUNT_TOO_LOW;
  CLASS_HASH_NOT_SUPPORTED: PAYMASTER_API.CLASS_HASH_NOT_SUPPORTED;
  PAYMASTER_TRANSACTION_EXECUTION_ERROR: PAYMASTER_API.TRANSACTION_EXECUTION_ERROR;
  INVALID_TIME_BOUNDS: PAYMASTER_API.INVALID_TIME_BOUNDS;
  INVALID_DEPLOYMENT_DATA: PAYMASTER_API.INVALID_DEPLOYMENT_DATA;
  INVALID_CLASS_HASH: PAYMASTER_API.INVALID_CLASS_HASH;
  INVALID_ID: PAYMASTER_API.INVALID_ID;
  UNKNOWN_ERROR: PAYMASTER_API.UNKNOWN_ERROR;
};

export type RPC_ERROR = RPC_ERROR_SET[keyof RPC_ERROR_SET];
